
<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ "/dir/";
%>
<c:set var="bp" value="<%=basePath%>"></c:set>
<html>
<head>
<title>商家列表信息页面</title>
<c:import url="hcommon.jsp"></c:import>
<c:import url="header.jsp"></c:import>
	<c:import url="left.jsp"></c:import>
<script>
	function choose(obj) {
		console.log(obj)
		if (obj.checked == true) {
			$("[name='ids']").prop("checked", true);
		} else {
			$("[name='ids']").prop("checked", false);
		}
	}
</script>
</head>
<body>
<div style="margin-top:80px ;margin-left: 240px">
	<div style="margin-left: 800px">
		<form method="post" action="goodsfindbyname">
		<input type="search" name="gname" placeholder="请输入商品名称">
		<input
			 value="查询"
			type="submit" />
		</form>
	</div>
		<form action="deleteGoods.action" method="post">
			<table class="table table-hover">
				<tr>
					<th><input type="checkbox" value="全选/全部选" onclick="choose(this)"/></th>
					<th>商品编号</th>
					<th>商品名称</th>
					<th>商品图片</th>
					<th>商品价格</th>
					<th>商品折扣</th>
					<th>商品评分</th>
					<th>商品类型编号</th>
					<th>商品种类名称</th>
					<th>商家编号</th>
					<th>商家名称</th>
					<th>option</th>
				</tr>
				<c:forEach var="inv" items="${list}">
					<tr>
					<td><input name="ids" type="checkbox" value="${inv.gid}" /></td>
						<td><a href="goodsfindbyid.action?gid=${inv.gid}">${inv.gid}</a></td>
						<td>${inv.gname}</td>
						<td><IMG src="${bp}${inv.gphoto}" width="60px" height="60px"></td>
						<td>${inv.gprice}</td>
						<td>${inv.discounter}</td>
						<td>${inv.ggrade}</td>
						<td>${inv.tid}</td>
						<td>${inv.type.tname}</td>
						<td>${inv.sid}</td>
						<td>${inv.store.sname}</td>
						<td><input onclick="javascript:location.href='toupdateGoods.action?gid=${inv.gid}'"
							value="修改" type="button" /></td>
					</tr>
				</c:forEach>
				<tr align="center">
					<td colspan="10"><input
							onclick="javascript:location.href='toaddGoods.action'" value="添加"
						type="button" /> <input value="删除" type="submit" /></td>
				</tr>
			</table>
		</form>
	</div>
</body>
</html>
